<template>
	<view class="container">
		<!-- <text class="yticon icon-arrow-left-top"></text> -->
		<view v-show="plashow" class="platop-css" @click="platop">
			<image src="../../static/pla.png" mode="widthFix"></image>
			<view>顶部</view>
		</view>
		<view class="sharePrice" v-if="showShare" @click="share">
			<text>分享</text>
			<!-- <view v-if="info.shareprice!=''">{{info.shareprice}}</view> -->
		</view>
		<view class="carousel">
			<swiper indicator-dots circular=true duration="400">
				<swiper-item class="swiper-item" v-for="(item,index) in info.pics" :key="index">
					<view class="image-wrapper">
						<image :src="item" class="loaded" mode="aspectFill" @click="previewImg(info.pics,index)">
						</image>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<!-- 限时购 -->
		<!-- <view class="limit"> -->
		<view class="limit" v-if="infoGoods.timestate=='after'">
			<image :src="info.skillpic" mode="widthFix"></image>
			<view class="limit-money">
				￥<text
					style="font-size: 56upx;color: rgb(248,218,165);font-weight: bold;">{{infoGoods.saleprice}}</text><text
					style="text-decoration: line-through;">￥{{infoGoods.productprice}}</text>
			</view>
			<view class="limit-time">
				距结束<text style="margin-left: 10upx;">{{timh}}</text><text
					style="color: rgb(109,33,255);font-weight: bold;background-color: transparent;width: auto;padding: 0 4upx;">:</text><text>{{timm}}</text><text
					style="color: rgb(109,33,255);font-weight: bold;background-color: transparent;width: auto;padding: 0 4upx;">:</text><text>{{timse}}</text>
			</view>
		</view>
		<view class="introduce-section">
			<text class="title" :user-select="true">{{infoGoods.title}}</text>
			<view class="price-box">
				<!-- <text class="price-tip">¥</text> -->
				<!-- <text class="price" v-if="infoGoods.min_price==infoGoods.max_price">¥{{infoGoods.marketprice}}</text> -->
				<!-- <text class="price" v-else>¥{{infoGoods.min_price-infoGoods.max_price}}</text> -->
				<text class="price"><text class="small">¥</text>{{Number(infoGoods.saleprice)}}</text>
				<text class="m-price">¥{{Number(infoGoods.productprice)}}</text>
				<view class="in_sj" v-if="info.isgift==1">升级团长</view>
				<!-- <view class="bot-row">
					<text>库存: {{infoGoods.total}}</text>
				</view> -->
			</view>
		</view>

		<view class="c-list">
			<view class="c-row b-b flex_between">
				<view class="tit">
					<view class="butie">
						<view>最高补贴<text style="font-size: 36rpx;">{{Number(info.goods.btrate)}}</text>%</view>
						<view v-if="info.shareprice!=''">分享{{info.shareprice}}元</view>
					</view>
				</view>
				<view class="no_refund" v-if="info.goods.norefund==1">此产品不退货，售后找客服</view>
			</view>
			<!-- <view class="c-row b-b">
				<text class="tit">库存: {{infoGoods.total}}</text>
			</view> -->
			<!-- <view class="c-row b-b">
				<text class="tit">售价</text>
				<view class="con-list con-list1">
					<text><text
							style="color: #fa436a;font-size: 34upx;padding-right: 10upx;">{{infoGoods.saleprice}}</text>元</text>
				</view>
			</view> -->
			<!-- <view class="c-row b-b">
				<text class="tit">VIP价</text>
				<view class="con-list con-list1">
					<text><text
							style="color: #fa436a;font-size: 34upx;padding-right: 10upx;">{{infoGoods.vipprice}}</text>元</text>
				</view>
			</view> -->

			<view class="c-row b-b" v-if="infoSaleset.enoughfree">
				<text class="tit">促销活动</text>
				<view class="con-list">
					<text>单仓订单满<text
							style="color: #fa436a;font-size: 28upx;padding: 0 10upx;">{{infoSaleset.enoughorder}}</text>元包邮</text>
					<text v-if="infoSaleset.enoughmoney>0" v-for="item in infoSaleset.enoughs">单笔订单满<text
							style="color: #fa436a;font-size: 28upx;padding: 0 10upx;">{{item.enough}}</text>元减<text
							style="color: #fa436a;font-size: 28upx;padding: 0 10upx;">{{item.money}}</text>元</text>
				</view>
			</view>
			<view class="c-row b-b" v-if="infoGoods.timestate=='after'">
				<text class="tit">限时购</text>
				<view class="con-list">
					<text>{{tim}}</text>
				</view>
			</view>
			<view class="c-row b-b" @tap="toggleSpec" v-if="infoGoods.hasoption=='1'?true:false">
				<text class="tit">商品规格</text>
				<view class="con">
					<text class="selected-text" v-if="isspecSelected.title">
						{{isspecSelected.title}}
					</text>
				</view>
				<text class="yticon icon-you"></text>
			</view>
		</view>

		<!-- 久久店铺 -->
		<!-- <view class="details-store"> -->
			<!--	<view class="details-store-title" @click="navTo('../index/index','home')">
				<image src="../../static/jiujiu.png" mode="widthFix"></image>
				<view>
					<view>久久爆品汇</view>
					<view>社交电商新零售一件批发平台</view>
				</view>
			</view> -->
<!-- 			<view class="details-store-cont">
				<view @click="navTo('../product/list')">查看全部商品</view>
				<view @click="navTo('../index/index','home')">进店逛逛</view>
			</view> -->
		<!-- </view> -->


		<!-- 图文详情 -->
		<view class="detail-desc" id="desc">
			<view class="d-header">
				<text>图文详情</text>
			</view>
			<jyf-parser :html="infoGoods.content" :selectable="true"></jyf-parser>
		</view>

		<!-- 底部操作菜单 -->
		<view class="page-bottom">
			<view class="p-b-btn" @click="kefu()">
				<image class="p-b-btn-img" src="../../static/kefu2.png" mode=""></image>
				<text>客服</text>
			</view>
			<!-- <navigator url="/pages/cart/cart" open-type="navigate" class="p-b-btn">
				<text class="yticon icon-gouwuche"></text>
				<text>购物车</text>
			</navigator> -->
			<view class="p-b-btn" :class="{active: info.isfavorite}" @click="toFavorite">
				<text class="yticon icon-shoucang"></text>
				<text>收藏</text>
			</view>

			<!-- <view class="action-btn-group" v-if="infoGoods.canaddcart&&infoGoods.canbuy">
				<view type="primary" class="action-btn no-border buy-now-btn" @tap="gocartshow()">加入购物车</view>
				<view type="primary" class="action-btn no-border add-cart-btn" @click="buyshow()">立即购买</view>
			</view> -->
			<!-- <view class="action-btn-group1" v-if="!infoGoods.canaddcart&&infoGoods.canbuy">
				<view type="primary" class="action-btn no-border add-cart-btn" @click="buyshow()">立即购买</view>
			</view> -->
			<view class="action-btn-group1" v-if="infoGoods.canbuy&&!isShare">
				<view type="primary" class="action-btn no-border add-cart-btn" @click="buyshow()">立即购买</view>
			</view>
			<view class="action-btn-group" v-if="infoGoods.canbuy&&isShare">
				<view type="primary" class="action-btn no-border buy-now-btn" @click="buyshow()">立即购买</view>
				<view type="primary" class="action-btn no-border add-cart-btn" @click="$navTo('/pages/mallHome/selfMall')">去商城</view>
			</view>
			<view class="action-btn-group1 opacity5" v-if="!infoGoods.canbuy">
				<view type="primary" class="action-btn no-border add-cart-btn">暂无法购买</view>
			</view>
			<view class="shouqin" v-if="shouqin">
				<view>已售罄</view>
			</view>
		</view>
		<view class="sharebg" v-if="shareimg!=''" @tap="removeimg">
			<!-- #ifdef APP-PLUS||MP-WEIXIN -->
			<image @longpress="toSave" :src="shareimg" mode="widthFix"></image>
			<!-- #endif -->
		</view>
		<po-pup v-if="popu" :info="info" :ids="shopid" :ok="ok" @cler="clet" :gui="gui?'1':'0'" />
	</view>
</template>

<script>
	import PoPup from './popup.vue';
	import jyfParser from "@/components/jyf-parser/jyf-parser";
	export default {
		data() {
			return {
				cid: '',
				shopid: "",
				info: '',
				infoGoods: '',
				infoSaleset: '',

				specSelected: [],
				isspecSelected: "",
				favorite: true,
				num: 1,
				shareimg: "",
				type: 0,
				popu: false,
				ok: '',
				shouqin: false,
				gui: false,
				tim: '',
				timh: '',
				timm: '',
				timse: '',
				plashow: false,
				mid: -1,
				showShare: false,
				isShare: false,
			};
		},
		async onLoad(options) {
			if (options.id) {
				this.shopid = options.id;
			}
			if (options.scene) {
				let scene = decodeURIComponent(options.scene);
				this.shopid = this.gup('goodsid', scene);
				this.mid = this.gup('mid', scene);
			}
			this.cid = options.cid;
			if(options.mid){
				this.mid = options.mid;
			}
			if(this.mid!=-1){
				this.isShare = true;
			}
			console.log(this.mid);
			this.Show();
			// await this.$onLaunched;
			if(!uni.getStorageSync('token')){
				this.getToken();
			}else{
				this.showShare = true;
			}
		},
		onPageScroll() {
			var top = '';
			const query = uni.createSelectorQuery().in(this);
			query.select('#desc').boundingClientRect(data => {
				top = data.top;
				this.plashow = top <= 120 ? true : false;
			}).exec();
		},
		components: {
			PoPup,
			jyfParser,
		},
		methods: {
			getToken(){
				uni.login({
					provider: 'weixin',
					success:res=> {
						this.$axios('login/autologin','POST','member',{
							aid: uni.getStorageSync('appid').slice(-4),
							mid: this.mid,
							code: res.code
						}).then(res=>{
							if(res.data.code == 200){
								uni.setStorageSync('token', res.data.data);
								uni.setStorageSync('Jh_recotabshops', 1);
								this.getSharePath();
								this.showShare = true;
							}
						})
					}
				})
			},
			// 初始化数据
			Show() {
				var that = this;
				uni.showLoading({
					title: '加载中'
				});
				this.$axios('detail/display', "POST", 'shop', {
					id: that.shopid,
					cid: this.cid
				}).then(res => {
					uni.hideLoading();
					if (res.data.code == 200) {
						that.info = res.data.data;
						that.infoGoods = that.info.goods;
						uni.setNavigationBarTitle({
							title: that.infoGoods.title
						})
						that.infoSaleset = that.info.saleset;
						this.$emit('display', that.info);

						if (that.info.goods.timestate == 'after') {
							var num2 = that.info.goods.timeend * 1000;
							var num = that.info.goods.timestart * 1000;
							var a = new Date() - 0;
							if (num < a) {
								num = a;
							}
							that.tim = timefun(num2 - num);
							var timarr = that.tim.split('天');
							that.timh = timarr[0] * 24 + (timarr[1].split(':')[0] - 0);
							that.timh = that.timh < 10 ? ('0' + that.timh) : that.timh;
							that.timm = timarr[1].split(':')[1];
							that.timse = timarr[1].split(':')[2];
							var s = setInterval(() => {
								if (num2 >= num) {
									that.tim = timefun(num2 - num);
									var timarr2 = that.tim.split('天');
									that.timh = timarr2[0] * 24 + (timarr2[1].split(':')[0] - 0);
									that.timh = that.timh < 10 ? ('0' + that.timh) : that.timh;
									that.timm = timarr2[1].split(':')[1];
									that.timse = timarr2[1].split(':')[2];
									num2 -= 1000;
								} else {
									clearInterval(s)
								}
							}, 1000)
						}
						if (this.info.goods.total <= 0) {
							this.shouqin = true;
						}
					}
				}, (error) => {

				})
			},
			// 长按保存图片
			toSave() {
				var that = this;
				uni.showModal({
					title: '图片保存',
					content: '确定要保存图片吗',
					success: e => {
						if (e['confirm']) {
							uni.downloadFile({
								url: that.shareimg,
								success: function(url) {
									uni.saveImageToPhotosAlbum({
										filePath: url.tempFilePath,
										success: function(e) {
											uni.showToast({
												title: '图片保存成功',
												icon: 'none',
												duration: 2200
											});
										},
									});
								},
								fail(e) {
									console.log(e)
								}
							});
						}
					}
				});
			},
			// 预览图片
			previewImg(logourl, number) {
				let _this = this;
				uni.previewImage({
					current: number,
					urls: logourl,
				});
			},
			// 跳转
			navTo(url, e) {
				if (e == 'home') {
					uni.switchTab({
						url
					})
				} else {
					uni.navigateTo({
						url
					})
				}
			},
			// 回到顶部
			platop() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				})
			},
			kefu() {
				if (this.urlKf) {
					uni.navigateTo({
						url: "/pages/web/web-view?type=kf"
					})
					return
				}
				this.getKf('get')
			},
			clet() {
				this.popu = !this.popu;
			},
			//规格弹窗开关
			toggleSpec(type) {
				var that = this;
				if (this.info.goods.total <= 0) {
					this.shouqin = true;
				} else {
					this.popu = !this.popu;
					this.ok = '完成';
					this.gui = true;
				}
			},
			//选择规格
			selectSpec(index, indextwo) {
				var that = this;
				this.$set(this.specSelected, index, indextwo)
				var specs = ''
				for (var i = 0; i < that.specSelected.length; i++) {
					if (specs == '') {
						specs = that.info.specs[i].items[that.specSelected[i]].id + specs
					} else {
						specs = that.info.specs[i].items[that.specSelected[i]].id + '_' + specs
					}
				}
				for (var j = 0; j < that.info.options.length; j++) {
					if (that.info.options[j].specs == specs) {
						that.isspecSelected = that.info.options[j];
					}
				}
			},
			//收藏
			toFavorite() {
				var that = this;
				this.$axios('favorite/set', "POST", 'shop', {
					id: that.shopid
				}).then(res => {
					if (res.data.code == 200) {
						that.info.isfavorite = res.data.data.isfavorite
					}
				}, (error) => {

				})
			},
			buyshow() {
				var that = this;
				if (this.info.goods.total <= 0) {
					this.shouqin = true;
				} else {
					this.popu = !this.popu;
					this.ok = '立即购买';
				}
			},
			buy() {
				var that = this;
				if (this.specSelected.length !== this.info.specs.length) {
					uni.showToast({
						title: "请选择规格",
						icon: "none"
					})
					return false
				}
				var optionid = that.isspecSelected.id;
				if (that.isspecSelected.id == undefined) {
					optionid = 0
				}
				uni.navigateTo({
					url: '/pages/order/createOrder?type=2&id=' + that.shopid + "&optionid=" + optionid +
						"&total=" + that.num
				})
			},
			stopPrevent() {},
			reduce() {
				var that = this;
				if (that.num >= 2) {
					that.num = that.num - 1
				}
			},
			add() {
				var that = this;
				if (that.num < 999) {
					that.num = that.num + 1
				}
			},
			gocartshow() {
				var that = this;
				if (this.info.goods.total <= 0) {
					uni.showToast({
						title: '已售罄',
						icon: "none",
						duration: 2000
					});
					this.shouqin = true;
				} else {
					this.popu = !this.popu;
					this.ok = '加入购物车';
				}

			},
			gocart() {
				var that = this;
				if (this.specSelected.length !== this.info.specs.length) {
					uni.showToast({
						title: "请选择规格",
						icon: "none"
					})
					return false
				}
				this.$axios('Cart/add', "POST", 'shop', {
					optionid: that.isspecSelected.id,
					total: that.num,
					id: that.shopid
				}).then(res => {
					if (res.data.code == 200) {
						uni.showToast({
							title: '添加成功',
							icon: "none",
							duration: 2000
						});
					}
				}, (error) => {

				})
			},
			share: function() {
				var that = this;
				uni.showLoading({
					title: '海报生成中',
					mask: true
				});
				this.$axios('detail/create_goods_poster', "POST", 'shop', {
					goodsid: that.shopid
				}).then(res => {
					if (res.data.code == 200) {
						that.shareimg = res.data.data.url
					}
					uni.hideLoading();
				}, (error) => {

				})
			},
			removeimg: function() {
				this.shareimg = ''
			}
		},
		onNavigationBarButtonTap(e) {
			if (e.type == "share") {
				this.share();
			}
		},
	}

	function timefun(num) {
		let date = new Date(num);
		let d = date.getDate() - 1; // 日
		let h = date.getHours() - 8;
		d = h < 0 ? d - 1 : d;
		d = d < 10 ? ('0' + d) : d;
		h = h < 0 ? 24 + h : h;
		h = h < 10 ? ('0' + h) : h; //小时补0
		let m = date.getMinutes();
		m = m < 10 ? ('0' + m) : m; //分钟补0
		let s = date.getSeconds();
		s = s < 10 ? ('0' + s) : s; //秒补0

		return d + '天   ' + h + ':' + m + ':' + s;
	}
</script>

<style lang='scss'>
	page {
		background: $page-color-base;
		padding-bottom: 160upx;
	}

	/* 限时购 */
	.limit {
		position: relative;
		/* background-color: #fff; */
		margin-top: -24rpx;
	}

	.limit image {
		width: 100%;
	}

	.limit-money {
		position: absolute;
		left: 40upx;
		top: 50%;
		transform: translateY(-40%);
		color: rgb(255, 255, 255);
		font-size: 30upx;
	}

	.limit-time {
		position: absolute;
		right: 16upx;
		top: 50%;
		transform: translateY(22%);
		color: rgb(109, 33, 255);
		font-size: 28upx;
	}

	.limit-time text {
		color: #fff;
		display: inline-block;
		border-radius: 10upx;
		text-align: center;
		/* width: 38upx; */
		line-height: 38upx;
		padding: 0 2px;
		background-color: rgb(109, 33, 255);
	}
	.sharePrice{
		font-size: 20rpx;
	    position: fixed;
	    right: 0;
	    top: 300px;
	    background-color: #8405dc;
	    border-radius: 16rpx 0 0 16rpx;
	    color: #fff;
	    text-align: center;
	    z-index: 50;
	    /* padding: 14rpx; */
		padding: 14rpx 8rpx 14rpx 18rpx;
		background: linear-gradient( 90deg, #A350E8 0%, #4E07A9 100%);
		text{
			font-size: 32rpx;
			letter-spacing: 8rpx;
			font-weight: bold;
		}
	}
	/* 久久店铺 */
	.details-store {
		background-color: #fff;
		margin-top: 16upx;
		padding: 20upx;
	}

	.details-store-title,
	.details-store-cont {
		display: flex;
		align-items: center;
		justify-content: start;
	}

	.details-store-title image {
		width: 20%;
		margin-right: 20upx;
	}

	.details-store-title view {
		overflow: hidden;
		font-size: 36upx;
		line-height: 50upx;
		color: $font-color-dark;
	}

	.details-store-title view:nth-child(2) {
		color: $font-color-base;
		font-size: 32upx;
	}

	.details-store-cont {
		justify-content: center;
		color: $font-color-light;
		font-size: 32upx;
	}

	.details-store-cont view {
		margin: 0 2%;
		border: 1px $border-color-dark solid;
		margin-top: 20upx;
		width: 48%;
		line-height: 66upx;
		text-align: center;
	}

	.platop-css {
		width: 70upx;
		height: 70upx;
		position: fixed;
		bottom: 200upx;
		right: 40upx;
		z-index: 799;
		border-radius: 50%;
		font-size: 22upx;
		text-align: center;
		line-height: 6upx;
		background-color: rgba(255, 255, 255, 0.7);
		color: #8a8a8a;
		border: 1px #8a8a8a solid;
		font-weight: 900;

		image {
			width: 65%;
			border-radius: 50%;
		}
	}

	.icon-you {
		font-size: $font-base + 2upx;
		color: #888;
	}

	.carousel {
		height: 722upx;
		position: relative;

		swiper {
			height: 100%;
		}

		.image-wrapper {
			width: 100%;
			height: 100%;
		}

		.swiper-item {
			display: flex;
			justify-content: center;
			align-content: center;
			height: 750upx;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}
		}

	}

	/* 标题简介 */
	.introduce-section {
		background: #fff;
		padding: 20upx 30upx 0;

		.title {
			font-size: 30rpx;
			color: $font-color-dark;
			height: 50upx;
			line-height: 50upx;
			/* font-weight: bold; */
		}

		.price-box {
			display: flex;
			align-items: center;
			height: 64upx;
			padding: 10upx 0;
			font-size: 24upx;
			color: $uni-color-primary;
			position: relative;
		}
		.in_sj{
			background: #000;
			color: gold;
			border-radius: 8rpx;
			line-height: 36rpx;
			padding: 0 10rpx;
			font-size: 22rpx;
		}

		.price {
			font-size: 44rpx;
			font-weight: bold;
			color:#AF141D;
			.small{
				font-size: 20rpx;
			}
		}

		.m-price {
			margin: 0 12upx;
			color: $font-color-light;
			text-decoration: line-through;
		}

		.coupon-tip {
			align-items: center;
			padding: 4upx 10upx;
			background: $uni-color-primary;
			font-size: $font-sm;
			color: #fff;
			border-radius: 6upx;
			line-height: 1;
			transform: translateY(-4upx);
			float: right;
		}

		.bot-row {
			display: flex;
			align-items: center;
			height: 50upx;
			font-size: $font-sm;
			color: $font-color-light;
			position: absolute;
			right: 0;

			text {
				flex: 1;
			}
		}
	}

	/* 分享 */
	.share-section {
		display: flex;
		align-items: center;
		color: $font-color-base;
		box-shadow: 0 20upx 40upx -16upx #fa436a;
		box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
		background: linear-gradient(to right, #ffac30, #fa436a, #F56C6C);
		border-radius: 10upx;
		padding: 12upx 30upx;
		position: fixed;
		top: 15upx;
		/* #ifdef APP-PLUS*/
		top: 60upx;
		/* #endif   */
		right: 0;
		z-index: 1000;

		.share-icon {
			display: flex;
			align-items: center;
			width: 70upx;
			height: 30upx;
			line-height: 1;
			border: 1px solid $uni-color-primary;
			border-radius: 4upx;
			position: relative;
			overflow: hidden;
			font-size: 22upx;
			color: $uni-color-primary;

			&:after {
				content: '';
				width: 50upx;
				height: 50upx;
				border-radius: 50%;
				left: -20upx;
				top: -12upx;
				position: absolute;
				background: $uni-color-primary;
			}
		}

		.icon-xingxing {
			position: relative;
			z-index: 1;
			font-size: 24upx;
			margin-left: 2upx;
			margin-right: 10upx;
			color: #fff;
			line-height: 1;
		}

		.tit {
			font-size: $font-base;
			margin-left: 10upx;
		}

		.icon-bangzhu1 {
			padding: 10upx;
			font-size: 30upx;
			line-height: 1;
		}

		.share-btn {
			flex: 1;
			text-align: right;
			font-size: $font-sm;
			color: #fff;
		}

		.icon-you {
			font-size: $font-sm;
			margin-left: 4upx;
			color: $uni-color-primary;
		}
	}

	.c-list {
		font-size: $font-lg;
		color: $font-color-base;
		background: #fff;

		.c-row {
			display: flex;
			align-items: center;
			padding: 20upx 30upx;
			position: relative;
		}

		.tit {
			/* width: 140upx; */
			padding-right: 20rpx;
		}
		.butie{
			color: $bg-color;
			font-weight: bold;
			font-size: 24rpx;
			margin-top: -22rpx;
			line-height: 50rpx;
		}
		.no_refund{
			background: #FFF0DA;
			color: #E19C37;
			line-height: 40rpx;
			padding: 2rpx 10rpx;
			border: 2rpx solid #E19C37;
			font-size: 24rpx;
			border-radius: 6rpx;
		}
		.con {
			flex: 1;
			color: $font-color-dark;

			.selected-text {
				margin-right: 10upx;
			}
		}

		.bz-list {
			height: 40upx;
			font-size: $font-sm+2upx;
			color: $font-color-dark;

			text {
				display: inline-block;
				margin-right: 30upx;
			}
		}

		.con-list {
			flex: 1;
			display: flex;
			flex-direction: column;
			color: $font-color-dark;
			line-height: 40upx;
		}

		.con-list1 {
			display: block;
		}

		.red {
			color: $uni-color-primary;
		}
	}

	.con-list>text {
		display: block;
	}

	.con-list1>text {
		display: inline-block;
	}

	/* 评价 */
	.eva-section {
		display: flex;
		flex-direction: column;
		padding: 20upx 30upx;
		background: #fff;
		margin-top: 16upx;

		.e-header {
			display: flex;
			align-items: center;
			height: 70upx;
			font-size: $font-sm + 2upx;
			color: $font-color-light;

			.tit {
				font-size: $font-base + 2upx;
				color: $font-color-dark;
				margin-right: 4upx;
			}

			.tip {
				flex: 1;
				text-align: right;
			}

			.icon-you {
				margin-left: 10upx;
			}
		}
	}

	.eva-box {
		display: flex;
		padding: 20upx 0;

		.portrait {
			flex-shrink: 0;
			width: 80upx;
			height: 80upx;
			border-radius: 100px;
		}

		.right {
			flex: 1;
			display: flex;
			flex-direction: column;
			font-size: $font-base;
			color: $font-color-base;
			padding-left: 26upx;

			.con {
				font-size: $font-base;
				color: $font-color-dark;
				padding: 20upx 0;
			}

			.bot {
				display: flex;
				justify-content: space-between;
				font-size: $font-sm;
				color: $font-color-light;
			}
		}
	}

	/*  详情 */
	.detail-desc {
		background: #fff;
		margin-top: 16upx;
		.d-header {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80upx;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			position: relative;

			text {
				padding: 0 20upx;
				background: #fff;
				position: relative;
				z-index: 1;
			}

			&:after {
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateX(-50%);
				width: 300upx;
				height: 0;
				content: '';
				border-bottom: 1px solid #ccc;
			}
		}
	}

	/* 规格选择弹窗 */
	.attr-content {
		padding: 10upx 30upx;

		.a-t {
			display: flex;

			image {
				width: 170upx;
				height: 170upx;
				flex-shrink: 0;
				margin-top: -40upx;
				border-radius: 8upx;
			}

			.right {
				display: flex;
				flex-direction: column;
				padding-left: 24upx;
				font-size: $font-sm + 2upx;
				color: $font-color-base;
				line-height: 42upx;

				.price {
					font-size: $font-lg;
					color: $uni-color-primary;
					margin-bottom: 10upx;
				}

				.selected-text {
					margin-right: 10upx;
				}
			}
		}

		.attr-list {
			display: flex;
			flex-direction: column;
			font-size: $font-base + 2upx;
			color: $font-color-base;
			padding-top: 30upx;
			padding-left: 10upx;
		}

		.item-list {
			padding: 20upx 0 0;
			display: flex;
			flex-wrap: wrap;

			text {
				display: flex;
				align-items: center;
				justify-content: center;
				background: #eee;
				margin-right: 20upx;
				margin-bottom: 20upx;
				border-radius: 100upx;
				min-width: 60upx;
				height: 60upx;
				padding: 0 20upx;
				font-size: $font-base;
				color: $font-color-dark;
			}

			.selected {
				background: #fbebee;
				color: $uni-color-primary;
			}
		}
	}

	/*  弹出层 */
	.popup {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 99;

		&.show {
			display: block;

			.mask {
				animation: showPopup 0.2s linear both;
			}

			.layer {
				animation: showLayer 0.2s linear both;
			}
		}

		&.hide {
			.mask {
				animation: hidePopup 0.2s linear both;
			}

			.layer {
				animation: hideLayer 0.2s linear both;
			}
		}

		&.none {
			display: none;
		}

		.mask {
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: 1;
			background-color: rgba(0, 0, 0, 0.4);
		}

		.layer {
			position: fixed;
			z-index: 99;
			bottom: 0;
			width: 100%;
			/* min-height: 40vh; */
			border-radius: 10upx 10upx 0 0;
			background-color: #fff;

			.btn {
				height: 66upx;
				line-height: 66upx;
				border-radius: 100upx;
				background: $uni-color-primary;
				font-size: $font-base + 2upx;
				color: #fff;
				margin: 30upx auto 20upx;
			}
		}

		@keyframes showPopup {
			0% {
				opacity: 0;
			}

			100% {
				opacity: 1;
			}
		}

		@keyframes hidePopup {
			0% {
				opacity: 1;
			}

			100% {
				opacity: 0;
			}
		}

		@keyframes showLayer {
			0% {
				transform: translateY(120%);
			}

			100% {
				transform: translateY(0%);
			}
		}

		@keyframes hideLayer {
			0% {
				transform: translateY(0);
			}

			100% {
				transform: translateY(120%);
			}
		}
	}

	/* 底部操作菜单 */
	.page-bottom {
		position: fixed;
		left: 50%;
		transform: translateX(-50%);
		bottom: 30upx;
		z-index: 95;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 690upx;
		height: 100upx;
		background: rgba(255, 255, 255, .9);
		box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
		border-radius: 16upx;

		.p-b-btn {
			position: relative;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			font-size: $font-sm;
			color: $font-color-base;
			width: 96upx;
			height: 80upx;

			.yticon {
				font-size: 40upx;
				line-height: 48upx;
				color: $font-color-light;
			}

			&.active,
			&.active .yticon {
				color: $uni-color-primary;
			}

			.icon-fenxiang2 {
				font-size: 42upx;
				transform: translateY(-2upx);
			}

			.icon-shoucang {
				font-size: 46upx;
			}
		}

		.action-btn-group {
			display: flex;
			height: 76upx;
			border-radius: 100px;
			overflow: hidden;
			/* box-shadow: 0 20upx 40upx -16upx #fa436a; */
			/* box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4); */
			/* background: linear-gradient(to right, #ffac30, #fa436a, #F56C6C); */
			background: linear-gradient( 270deg, #8917E2 0%, #B92DF1 100%);
			margin-left: 20upx;
			position: relative;

			&:after {
				content: '';
				position: absolute;
				top: 50%;
				right: 50%;
				transform: translateY(-50%);
				height: 28upx;
				width: 0;
				border-right: 1px solid rgba(255, 255, 255, .5);
			}

			.action-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 210rpx;
				height: 100%;
				font-size: $font-base;
				padding: 0;
				border-radius: 0;
				background: transparent;
				color: #fff;
			}
		}

		.action-btn-group1 {
			display: flex;
			height: 76rpx;
			border-radius: 100px;
			overflow: hidden;
			/* box-shadow: 0 20upx 40upx -16upx #fa436a; */
			/* box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4); */
			/* background: linear-gradient(to right, #ffac30, #fa436a, #c902e2); */
			background: linear-gradient( 270deg, #8917E2 0%, #B92DF1 100%);
			margin-left: 20upx;
			position: relative;

			.action-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				/* width: 360upx; */
				width: 440rpx;
				height: 100%;
				font-size: $font-base;
				padding: 0;
				border-radius: 0;
				background: transparent;
				color: #fff;
			}
		}

		.shouqin {
			position: absolute;
			right: 10upx;
			color: #606266;
			background-color: #fff;
			height: calc(100% - 20upx);
			/* width: 380upx; */
			width: 460rpx;
			background-color: #C0C4CC;
			border-radius: 150upx;
			overflow: hidden;
			box-shadow: 2upx 2upx 2upx 1upx #C0C4CC;
		}

		.shouqin view {
			font-size: 36upx;
			line-height: 100%;
			text-align: center;
			line-height: 80upx;
		}
	}

	.c_addnum {
		display: flex;
		align-items: center;
		justify-content: space-between;

		.c_addnums {
			display: flex;
			align-items: center;

			.c_addnums1 {
				width: 60upx;
				height: 60upx;
				text-align: center;
				line-height: 60upx;
			}

			.c_addnums2 {
				width: 60upx;
				height: 60upx;
				text-align: center;
				line-height: 60upx;
				background: #eee;
			}
		}
	}

	.sharebg {
		position: fixed;
		z-index: 998;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.3);

		image {
			width: 80%;
			position: fixed;
			left: 50%;
			top: 50%;
			z-index: 999;
			transform: translate(-50%, -50%);
		}
	}

	.p-b-btn-img {
		width: 40upx;
		height: 40upx;
		transform: translateY(4upx);
		margin-bottom: 8upx;
	}

	.h1_jcvideo_msg {
		position: fixed;
		right: 0;
	}
</style>